
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Arquivo {

    public Object[] values;

    public void LeIni(String filename) throws FileNotFoundException, Exception {

        boolean fileexists = (new File(filename)).exists();
        if (fileexists) {
            InputStream is = new FileInputStream(filename);
            Scanner entrada = new Scanner(is);
            String str;
            List<String> lValues = new ArrayList<String>();
            values = null; //new Object[0];

            while (entrada.hasNextLine()) {
                str = entrada.nextLine().trim();
                if (str.contains("=")) {
                    lValues.add(str.substring(str.indexOf("=") + 1, str.length()));
                }
            }

            is.close();
            values = lValues.toArray();
        } else {
            throw new Exception("Arquivo " + filename + " nao encontrado no diretorio raiz");
        }
    }
}